feat: allow returning multiple values as tuples instead of lists#551
feat: allow returning multiple values as tuples instead of lists#551
Conversation
In Python, the natural way to return multiple values from a function is as a tuple. Change the docs to recommend returning tuples instead of lists for D-Bus methods and signals that return multiple values. Tests are updated as well to show that tuples are preferred (and that this is not a breaking change).
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #551 +/- ##
==========================================
+ Coverage 85.26% 85.31% +0.05%
==========================================
Files 28 28
Lines 3433 3433
Branches 601 601
==========================================
+ Hits 2927 2929 +2
+ Misses 313 312 -1
+ Partials 193 192 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #551 will not alter performanceComparing Summary
|
|
Interesting, it breaks Cython. Was not expecting that. It may be a breaking change after all. |
|
Well, not breaking in the semver sense since we aren't changing the library itself. But rather would be a feature to allow Cython to accept tuple in addition to list. |
|
I'll have to think about this some more. There are two sides to this, only one of which has been addressed so far. The first is relaxing the allowable types for The part I haven't addressed though is that I've just realized that in addition to #526 there is also the case where returning multiple values should also be implemented as a |
In Python, the natural way to return multiple values from a function is
as a tuple. Change the docs to recommend returning tuples instead of lists
for D-Bus methods and signals that return multiple values.
Tests are updated as well to show that tuples are preferred (and that
this is not a breaking change).